package com.hyd.issues.project;

import com.hyd.dao.DataAdapter;
import com.hyd.dao.Table;
import com.hyd.issues.DaoUtil;

/**
 * (description)
 *
 * @author yiding.he
 */
@Table(name = "projects")
public class Project {

    private Long id;

    private String projectName;

    private Long adminUserId;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public Long getAdminUserId() {
        return adminUserId;
    }

    public void setAdminUserId(Long adminUserId) {
        this.adminUserId = adminUserId;
    }

    ///////////////////////////////////////////////////////////////

    private static DataAdapter<Project> adapter = DaoUtil.getDAO().createDataAdapter(Project.class);

    public static void create(String projectName, Long adminUserId) {
        Project p = new Project();
        p.setProjectName(projectName);
        p.setAdminUserId(adminUserId);

        adapter.save(p);
    }
}
